#include "langsDialog.h"

langsDialog::langsDialog(QWidget *parent)
    : QDialog(parent)
{
	ui.setupUi(this);
	connect(ui.okButton,SIGNAL(clicked()),this,SLOT(saveLangs()));
}

void langsDialog::setLangs(const QStringList& langList)
{
    mLangs = langList;
	ui.From->addItems(mLangs);
	ui.To->addItems(mLangs);
}

langsDialog::~langsDialog()
{

}

void langsDialog::saveLangs()
{
	emit langChanged(ui.From->currentText(),ui.To->currentText());
	hide();
}

void langsDialog::closeEvent(QCloseEvent *event)
{
	hide();
	event->ignore();
}
